package com.github.caijh.mall.system.service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.caijh.mall.system.model.SystemAdmin;
import com.github.caijh.mall.system.request.SystemAdminAddReqBody;
import com.github.caijh.mall.system.request.SystemAdminLoginReqBody;
import com.github.caijh.mall.system.request.SystemAdminReqBody;
import com.github.caijh.mall.system.request.SystemAdminRequest;
import com.github.caijh.mall.system.request.SystemAdminUpdateReqBody;
import com.github.caijh.mall.system.response.SystemAdminRespBody;

/**
 * SystemAdminService 接口
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * | Author: CRMEB Team <admin@crmeb.com>
 * +----------------------------------------------------------------------
 */
public interface SystemAdminService extends IService<SystemAdmin> {

    List<SystemAdminRespBody> getList(SystemAdminReqBody reqBody);

    SystemAdminRespBody getInfo(SystemAdminRequest request);

    SystemAdminRespBody login(SystemAdminLoginReqBody request, String ip);

    /**
     * 根据Token获取对应用户信息
     *
     * @param token
     * @return
     */
    SystemAdminRespBody getInfoByToken(String token);

    /**
     * 用户登出
     *
     * @param token
     * @return
     * @throws Exception
     */
    Boolean logout(String token);

    /**
     * 新增管理员
     *
     * @param systemAdminAddReqBody
     * @return
     */
    SystemAdminRespBody add(SystemAdminAddReqBody systemAdminAddReqBody);

    SystemAdminRespBody update(SystemAdminUpdateReqBody reqBody);

    Integer getAdminId();

    SystemAdmin getInfo(Integer adminId);

    SystemAdmin getInfo();

    SystemAdminRespBody weChatAuthorizeLogin(String code, String ip);

    Boolean unBind();

    void bind(String wxCode, Integer adminId);

    boolean updateStatus(Integer id, Boolean status);

}
